package com.example.sringboot_web.config;

import com.example.sringboot_web.Interceptor.MyHandlerInterceptor;
import com.example.sringboot_web.Interceptor.MyHandlerInterceptor1;
import com.example.sringboot_web.Interceptor.MyHandlerInterceptor2;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class interceptorConfig implements WebMvcConfigurer {

    @Bean
    public MyHandlerInterceptor myHandlerInterceptor() {
        return new MyHandlerInterceptor();
    }
    @Bean
    public MyHandlerInterceptor1 myHandlerInterceptor1() {
        return new MyHandlerInterceptor1();
    }
    @Bean
    public MyHandlerInterceptor2 myHandlerInterceptor2() {
        return new MyHandlerInterceptor2();
    }


/*    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myHandlerInterceptor()).addPathPatterns("/index/*");
        registry.addInterceptor(myHandlerInterceptor1()).addPathPatterns("/index/*");
        registry.addInterceptor(myHandlerInterceptor2()).addPathPatterns("/index/*");
    }*/
}
